<%@ page language="java" contentType="text/html; charset=utf-8"
	pageEncoding="utf-8"%>

<%@ page import="com.sms.user.*"%>

<%
	response.setCharacterEncoding("utf-8");
	String action = request.getParameter("action");
	if (action != null && action.equals("login")) {
		String userno = request.getParameter("userno");
		String password = request.getParameter("password");
		String role = request.getParameter("role");

		boolean isSuccess = User.check(role, userno, password);
		String msg = "error";
		if (isSuccess) {
			session.setAttribute("userno", userno);
			session.setAttribute("role", role);
			msg = "ok";
		} 
		
		msg = new String(msg.getBytes("ISO-8859-1"), "utf-8");
		out.clear();
		out.write(msg);
		
	}
%>